-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avkr003/leverage improvements #752
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… add all their test cases
…increasing it's test coverage to 90%
…003/leverageImprovements
amityadav0
reviewed
Aug 26, 2024
…003/leverageImprovements
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #752 +/- ##
==========================================
+ Coverage 40.37% 42.44% +2.06%
==========================================
Files 627 626 -1
Lines 20347 20387 +40
==========================================
+ Hits 8216 8654 +438
+ Misses 11107 10736 -371
+ Partials 1024 997 -27 |
…003/leverageImprovements
…003/leverageImprovements
cosmic-vagabond
approved these changes
Aug 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Key Changes:
Earlier when adding a pool to leverage LP, we were not validating with module params max allowed and when opening position, we were directly comparing to module params from user tx. Now, we set pool leverage max by comparing with module params and while opening position, we compare with pool leverage max, not module params max. Add Pool Open position
CheckAndLiquidateUnhealthyPosition and CheckAndCloseAtStopLoss always return an error if the position is not closed. Changed return variable
earlyReturn
tocloseAttempted
and changed logic everywhere else accordingly.earlyReturn
was ambiguous where it was returning from.closeAttempted
returns true ifForceCloseLong
has been called in the function.Remove
IsPoolEnabled
andIsPoolClosed
functions as it was adding a pool without any governance proposalAdded msg basic validations
In msg_close_positions, not allowing repeating close position IDs including both stop loss and unhealthy positions
0 stop loss price while opening position is allowed indicating not set by the user. (based on testnet app) here
Not allow same position ids while claiming rewards here
Params validation: